<template>
	<view class="opinionBox">
		<textarea value="" placeholder="请填写你要反馈的问题" class="textarea" v-model="textValue"/>
		<view class="sureBtn" @click="subMit">
			提交
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				textValue:''
			}
		},
		created() {
		},
		methods: {
			subMit(){
				if(this.textValue == ''){
					uni.showToast({
						title:'请输入意见反馈',
						duration:1000,
						icon:'none'
					})
					return
				}
				this.$u.post('/idea/feedback',{idea:this.textValue}).then(res => {
						if (res) {
							console.log(res,'rrr')
							uni.showToast({
								title:'反馈成功',
								duration:1000,
								icon:'none'
							})
							setTimeout(()=>{
								uni.navigateBack({
								    delta: 2
								});
							},1500)
						}
					})
					.catch((res) => {
						console.log(res.message)
					})
			}
		}
	}
</script>

<style>
	.opinionBox{
		background-color: #F5F5F5;
	}
	.textarea{
		width: 100%;
		height: 430rpx;
		padding: 36rpx;
		background-color: white;
		margin-top: 16rpx;
		border-top: 16rpx solid #F5F5F5;
	}
		.sureBtn{
			width:681rpx;
			height:88rpx;
			background:rgba(92,20,255,1);
			opacity:0.9;
			border-radius:44rpx;
			margin: 120rpx auto;
			text-align: center;
			line-height: 88rpx;
			font-size:36rpx;
			font-weight:bold;
			color:rgba(255,255,255,1);
		}
</style>
